package com.xr.miniprogram.tools.RedissonUtil;

import com.xr.miniprogram.domain.MiniProgramOrder;
import com.xr.miniprogram.service.WXPayService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


/**
 * 描述: 订单支付超时处理类
 */
@Component
@Slf4j
public class OrderPaymentTimeout implements RedisDelayQueueHandle<Object> {
    @Resource
    private WXPayService wxPayService;

    @Override
    public void execute(Object value) {
        log.info("(收到订单支付超时延迟消息) {}", value);
        // TODO 订单支付超时，自动取消订单处理业务...
        try {
            wxPayService.checkOrderStatus(String.valueOf(value));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}